from celery import Celery

import os
if not os.getenv('DJANGO_SETTINGS_MODULE'):
    os.environ['DJANGO_SETTINGS_MODULE'] = 'meiduo_all.settings.dev'


celery_app = Celery('meiduo')
celery_app.config_from_object('celery_tasks.config')
# 自动将异步任务注册到celery_app
# 提示：不需要指向tasks.py;因为celery默认回去寻找tasks.py同名文件
celery_app.autodiscover_tasks(['celery_tasks.sms','celery_tasks.email'])